Memory management for complex image analysis

ABSTRACT

Various embodiments are provided for managing memory for image analysis in a computing environment by a processor. An estimated amount of memory may be reserved for an image analysis job. During a processing of the image analysis job, at least one thread of the image analysis job is partially suspended by restricting the image analysis job from requesting allocation of additional memory upon memory requirements for the image analysis job exceeding the estimated amount of memory. Commensurate with partially suspending the at least one thread, a state of the image analysis job is maintained in the memory notwithstanding the processing of the at least one thread associated with the state is suspended.

BACKGROUND OF THE INVENTION Field of the Invention

The present invention relates in general to computing systems, and moreparticularly to, various embodiments for managing memory for compleximage analysis in a computing environment by a processor.

Description of the Related Art

In today's society, consumers, businesspersons, educators, and otherscommunicate over a wide variety of mediums in real time, across greatdistances, and many times without boundaries or borders. With theincreased usage of computing networks, such as the Internet, humans arecurrently inundated and overwhelmed with the amount of informationavailable to them from various structured and unstructured sources. Dueto the recent advancement of information technology and the growingpopularity of the Internet, a wide variety of computer systems have beenused in machine learning. Machine learning is a form of artificialintelligence that is employed to allow computers to evolve behaviorsbased on empirical data.

SUMMARY OF THE INVENTION

Various embodiments for managing memory for complex image analysis by aprocessor, are provided. In one embodiment, by way of example only, amethod for managing memory for image analysis in a computingenvironment, again by a processor, is provided. An estimated amount ofmemory may be reserved for an image analysis job. During a processing ofthe image analysis job, at least one thread of the image analysis job ispartially suspended by restricting the image analysis job fromrequesting allocation of additional memory upon memory requirements forthe image analysis job exceeding the estimated amount of memory.Commensurate with partially suspending the at least one thread, a stateof the image analysis job is maintained in the memory notwithstandingthe processing of the at least one thread associated with the state issuspended. An upper bound of the estimated amount of memory may beestimated/predicted using a linear regression model with imageresolution as an independent variable and a prediction interval. Thelinear regression model may be trained using a target function thatpenalizes under estimation of the estimated amount of memory as comparedto over estimation.

BRIEF DESCRIPTION OF THE DRAWINGS

In order that the advantages of the invention will be readilyunderstood, a more particular description of the invention brieflydescribed above will be rendered by reference to specific embodimentsthat are illustrated in the appended drawings. Understanding that thesedrawings depict only typical embodiments of the invention and are nottherefore to be considered to be limiting of its scope, the inventionwill be described and explained with additional specificity and detailthrough the use of the accompanying drawings, in which:

FIG. 1 is a block diagram depicting an exemplary cloud computing nodeaccording to an embodiment of the present invention;

FIG. 2 is an additional block diagram depicting an exemplary cloudcomputing environment according to an embodiment of the presentinvention;

FIG. 3 is an additional block diagram depicting abstraction model layersaccording to an embodiment of the present invention;

FIG. 4 is an additional block diagram depicting various user hardwareand computing components functioning in accordance with aspects of thepresent invention;

FIGS. 5A-5B are a diagram depicting managing memory for complex imageanalysis using a linear regression model in accordance with aspects ofthe present invention;

FIG. 6 is an additional block diagram depicting managing memory forcomplex image analysis according to a defined memory state in accordancewith aspects of the present invention;

FIG. 7 is an additional block diagram depicting a spilling operation formanaging memory for complex image analysis according to a defined memorystate in accordance with aspects of the present invention;

FIG. 8 is a flowchart diagram depicting an exemplary method for managingmemory for complex image analysis in a computing environment, again inwhich various aspects of the present invention may be realized; and

FIG. 9 is an additional flowchart diagram depicting an additionalexemplary method for managing memory for complex image analysis in acomputing environment, again in which various aspects of the presentinvention may be realized.

DETAILED DESCRIPTION OF THE DRAWINGS

Big Data is a collection of tools, techniques, and operations used fordata sets that becomes so voluminous and complex that traditional dataprocessing applications are inadequate to store, query, analyze orprocess the data sets using current database management and datawarehousing tools or traditional data processing applications. Forexample, image analysis is an important type of big data analytics. Suchanalysis may include medical image analysis (e.g., anatomy segmentation,computer aided diagnosis), general three-dimensional (“3D”) imageanalysis (e.g., surveillance video analysis) and two-dimensional (“2D”)image analysis (e.g., scene reconstruction, event detection, objectrecognition). Imagine analysis may involve a computing system havingcharacteristics such as, for example: central processing unit (“CPU”)and memory intensive, a large number of images being processed at thesame time, one or more long-running jobs (e.g., job exceeding a definedtime period threshold), and/or one or more prohibitively expensivefailures. Thus, a need exists from increasing computing efficiency andproviding memory management operations needed to prevent performancedegradation or costly job failures due to out-of-memory errors.

Accordingly, the present invention provides an orchestrated collectionof operations based on safe upper bound estimation of job memory usage,thread compression and spilling. In one aspect, the present inventionprovides for managing memory for image analysis in a computingenvironment. An estimated amount of memory may be reserved for one ormore image analysis jobs and partially suspending the one or more imageanalysis jobs upon memory requirements for the one or more imageanalysis jobs exceeding the estimated amount of memory. An upper boundof the estimated amount of memory may be estimated/predicted using alinear regression model with image resolution as an independent variableand a prediction interval. The linear regression model may be trainedusing a target function that penalizes under estimation of the estimatedamount of memory as compared to over estimation.

In an additional aspect, the memory management may be performed in threemain stages: 1) predict memory requirements and launch job withpredicted amount, 2) if a job still exceeds memory capacity, theapplication may be compressed to ensure completion, and/or 3) if a jobstill exceeds memory capacity, one or more partitions may be spilled toensure completion.

It is understood in advance that although this disclosure includes adetailed description on cloud computing, implementation of the teachingsrecited herein are not limited to a cloud computing environment. Rather,embodiments of the present invention are capable of being implemented inconjunction with any other type of computing environment now known orlater developed.

Cloud computing is a model of service delivery for enabling convenient,on-demand network access to a shared pool of configurable computingresources (e.g., networks, network bandwidth, servers, processing,memory, storage, applications, virtual machines, and services) that canbe rapidly provisioned and released with minimal management effort orinteraction with a provider of the service. This cloud model may includeat least five characteristics, at least three service models, and atleast four deployment models.

Characteristics are as follows:

On-demand self-service: a cloud consumer can unilaterally provisioncomputing capabilities, such as server time and network storage, asneeded automatically without requiring human interaction with theservice's provider.

Broad network access: capabilities are available over a network andaccessed through standard mechanisms that promote use by heterogeneousthin or thick client platforms (e.g., mobile phones, laptops, and PDAs).

Resource pooling: the provider's computing resources are pooled to servemultiple consumers using a multi-tenant model, with different physicaland virtual resources dynamically assigned and reassigned according todemand. There is a sense of location independence in that the consumergenerally has no control or knowledge over the exact location of theprovided resources but may be able to specify location at a higher levelof abstraction (e.g., country, state, or datacenter).

Rapid elasticity: capabilities can be rapidly and elasticallyprovisioned, in some cases automatically, to quickly scale out andrapidly released to quickly scale in. To the consumer, the capabilitiesavailable for provisioning often appear to be unlimited and can bepurchased in any quantity at any time.

Measured service: cloud systems automatically control and optimizeresource use by leveraging a metering capability at some level ofabstraction appropriate to the type of service (e.g., storage,processing, bandwidth, and active user accounts). Resource usage can bemonitored, controlled, and reported providing transparency for both theprovider and consumer of the utilized service.

Service Models are as follows:

Software as a Service (SaaS): the capability provided to the consumer isto use the provider's applications running on a cloud infrastructure.The applications are accessible from various client devices through athin client interface such as a web browser (e.g., web-based e-mail).The consumer does not manage or control the underlying cloudinfrastructure including network, servers, operating systems, storage,or even individual application capabilities, with the possible exceptionof limited user-specific application configuration settings.

Platform as a Service (PaaS): the capability provided to the consumer isto deploy onto the cloud infrastructure consumer-created or acquiredapplications created using programming languages and tools supported bythe provider. The consumer does not manage or control the underlyingcloud infrastructure including networks, servers, operating systems, orstorage, but has control over the deployed applications and possiblyapplication hosting environment configurations.

Infrastructure as a Service (IaaS): the capability provided to theconsumer is to provision processing, storage, networks, and otherfundamental computing resources where the consumer is able to deploy andrun arbitrary software, which can include operating systems andapplications. The consumer does not manage or control the underlyingcloud infrastructure but has control over operating systems, storage,deployed applications, and possibly limited control of select networkingcomponents (e.g., host firewalls).

Deployment Models are as follows:

Private cloud: the cloud infrastructure is operated solely for anorganization. It may be managed by the organization or a third party andmay exist on-premises or off-premises.

Community cloud: the cloud infrastructure is shared by severalorganizations and supports a specific community that has shared concerns(e.g., mission, security requirements, policy, and complianceconsiderations). It may be managed by the organizations or a third partyand may exist on-premises or off-premises.

Public cloud: the cloud infrastructure is made available to the generalpublic or a large industry group and is owned by an organization sellingcloud services.

Hybrid cloud: the cloud infrastructure is a composition of two or moreclouds (private, community, or public) that remain unique entities butare bound together by standardized or proprietary technology thatenables data and application portability (e.g., cloud bursting forload-balancing between clouds).

A cloud computing environment is service oriented with a focus onstatelessness, low coupling, modularity, and semantic interoperability.At the heart of cloud computing is an infrastructure comprising anetwork of interconnected nodes.

Referring now to FIG. 1, a schematic of an example of a cloud computingnode is shown. Cloud computing node 10 is only one example of a suitablecloud computing node and is not intended to suggest any limitation as tothe scope of use or functionality of embodiments of the inventiondescribed herein. Regardless, cloud computing node 10 is capable ofbeing implemented and/or performing any of the functionality set forthhereinabove.

In cloud computing node 10 there is a computer system/server 12, whichis operational with numerous other general purpose or special purposecomputing system environments or configurations. Examples of well-knowncomputing systems, environments, and/or configurations that may besuitable for use with computer system/server 12 include, but are notlimited to, personal computer systems, server computer systems, thinclients, thick clients, hand-held or laptop devices, multiprocessorsystems, microprocessor-based systems, set top boxes, programmableconsumer electronics, network PCs, minicomputer systems, mainframecomputer systems, and distributed cloud computing environments thatinclude any of the above systems or devices, and the like.

Computer system/server 12 may be described in the general context ofcomputer system-executable instructions, such as program modules, beingexecuted by a computer system. Generally, program modules may includeroutines, programs, objects, components, logic, data structures, and soon that perform particular tasks or implement particular abstract datatypes. Computer system/server 12 may be practiced in distributed cloudcomputing environments where tasks are performed by remote processingdevices that are linked through a communications network. In adistributed cloud computing environment, program modules may be locatedin both local and remote computer system storage media including memorystorage devices.

As shown in FIG. 1, computer system/server 12 in cloud computing node 10is shown in the form of a general-purpose computing device. Thecomponents of computer system/server 12 may include, but are not limitedto, one or more processors or processing units 16, a system memory 28,and a bus 18 that couples various system components including systemmemory 28 to processor 16.

Bus 18 represents one or more of any of several types of bus structures,including a memory bus or memory controller, a peripheral bus, anaccelerated graphics port, and a processor or local bus using any of avariety of bus architectures. By way of example, and not limitation,such architectures include Industry Standard Architecture (ISA) bus,Micro Channel Architecture (MCA) bus, Enhanced ISA (EISA) bus, VideoElectronics Standards Association (VESA) local bus, and PeripheralComponent Interconnects (PCI) bus.

Computer system/server 12 typically includes a variety of computersystem readable media. Such media may be any available media that isaccessible by computer system/server 12, and it includes both volatileand non-volatile media, removable and non-removable media.

System memory 28 can include computer system readable media in the formof volatile memory, such as random access memory (RAM) 30 and/or cachememory 32. Computer system/server 12 may further include otherremovable/non-removable, volatile/non-volatile computer system storagemedia. By way of example only, storage system 34 can be provided forreading from and writing to a non-removable, non-volatile magnetic media(not shown and typically called a “hard drive”). Although not shown, amagnetic disk drive for reading from and writing to a removable,non-volatile magnetic disk (e.g., a “floppy disk”), and an optical diskdrive for reading from or writing to a removable, non-volatile opticaldisk such as a CD-ROM, DVD-ROM or other optical media can be provided.In such instances, each can be connected to bus 18 by one or more datamedia interfaces. As will be further depicted and described below,system memory 28 may include at least one program product having a set(e.g., at least one) of program modules that are configured to carry outthe functions of embodiments of the invention.

Program/utility 40, having a set (at least one) of program modules 42,may be stored in system memory 28 by way of example, and not limitation,as well as an operating system, one or more application programs, otherprogram modules, and program data. Each of the operating system, one ormore application programs, other program modules, and program data orsome combination thereof, may include an implementation of a networkingenvironment. Program modules 42 generally carry out the functions and/ormethodologies of embodiments of the invention as described herein.

Computer system/server 12 may also communicate with one or more externaldevices 14 such as a keyboard, a pointing device, a display 24, etc.;one or more devices that enable a user to interact with computersystem/server 12; and/or any devices (e.g., network card, modem, etc.)that enable computer system/server 12 to communicate with one or moreother computing devices. Such communication can occur via Input/Output(I/O) interfaces 22. Still yet, computer system/server 12 cancommunicate with one or more networks such as a local area network(LAN), a general wide area network (WAN), and/or a public network (e.g.,the Internet) via network adapter 20. As depicted, network adapter 20communicates with the other components of computer system/server 12 viabus 18. It should be understood that although not shown, other hardwareand/or software components could be used in conjunction with computersystem/server 12. Examples include, but are not limited to: microcode,device drivers, redundant processing units, external disk drive arrays,RAID systems, tape drives, and data archival storage systems, etc.

Referring now to FIG. 2, illustrative cloud computing environment 50 isdepicted. As shown, cloud computing environment 50 comprises one or morecloud computing nodes 10 with which local computing devices used bycloud consumers, such as, for example, personal digital assistant (PDA)or cellular telephone 54A, desktop computer 54B, laptop computer 54C,and/or automobile computer system 54N may communicate. Nodes 10 maycommunicate with one another. They may be grouped (not shown) physicallyor virtually, in one or more networks, such as Private, Community,Public, or Hybrid clouds as described hereinabove, or a combinationthereof. This allows cloud computing environment 50 to offerinfrastructure, platforms and/or software as services for which a cloudconsumer does not need to maintain resources on a local computingdevice. It is understood that the types of computing devices 54A-N shownin FIG. 2 are intended to be illustrative only and that computing nodes10 and cloud computing environment 50 can communicate with any type ofcomputerized device over any type of network and/or network addressableconnection (e.g., using a web browser).

Referring now to FIG. 3, a set of functional abstraction layers providedby cloud computing environment 50 (FIG. 2) is shown. It should beunderstood in advance that the components, layers, and functions shownin FIG. 3 are intended to be illustrative only and embodiments of theinvention are not limited thereto. As depicted, the following layers andcorresponding functions are provided:

Device layer 55 includes physical and/or virtual devices, embedded withand/or standalone electronics, sensors, actuators, and other objects toperform various tasks in a cloud computing environment 50. Each of thedevices in the device layer 55 incorporates networking capability toother functional abstraction layers such that information obtained fromthe devices may be provided thereto, and/or information from the otherabstraction layers may be provided to the devices. In one embodiment,the various devices inclusive of the device layer 55 may incorporate anetwork of entities collectively known as the “internet of things”(IoT). Such a network of entities allows for intercommunication,collection, and dissemination of data to accomplish a great variety ofpurposes, as one of ordinary skill in the art will appreciate.

Device layer 55 as shown includes sensor 52, actuator 53, “learning”thermostat 56 with integrated processing, sensor, and networkingelectronics, camera 57, controllable household outlet/receptacle 58, andcontrollable electrical switch 59 as shown. Other possible devices mayinclude, but are not limited to various additional sensor devices,networking devices, electronics devices (such as a remote-controldevice), additional actuator devices, so called “smart” appliances suchas a refrigerator or washer/dryer, and a wide variety of other possibleinterconnected objects.

Hardware and software layer 60 includes hardware and softwarecomponents. Examples of hardware components include: mainframes 61; RISC(Reduced Instruction Set Computer) architecture-based servers 62;servers 63; blade servers 64; storage devices 65; and networks andnetworking components 66. In some embodiments, software componentsinclude network application server software 67 and database software 68.

Virtualization layer 70 provides an abstraction layer from which thefollowing examples of virtual entities may be provided: virtual servers71; virtual storage 72; virtual networks 73, including virtual privatenetworks; virtual applications and operating systems 74; and virtualclients 75.

In one example, management layer 80 may provide the functions describedbelow. Resource provisioning 81 provides dynamic procurement ofcomputing resources and other resources that are utilized to performtasks within the cloud computing environment. Metering and Pricing 82provides cost tracking as resources are utilized within the cloudcomputing environment, and billing or invoicing for consumption of theseresources. In one example, these resources may comprise applicationsoftware licenses. Security provides identity verification for cloudconsumers and tasks, as well as protection for data and other resources.User portal 83 provides access to the cloud computing environment forconsumers and system administrators. Service level management 84provides cloud computing resource allocation and management such thatrequired service levels are met. Service Level Agreement (SLA) planningand fulfillment 85 provides pre-arrangement for, and procurement of,cloud computing resources for which a future requirement is anticipatedin accordance with an SLA.

Workloads layer 90 provides examples of functionality for which thecloud computing environment may be utilized. Examples of workloads andfunctions which may be provided from this layer include: mapping andnavigation 91; software development and lifecycle management 92; virtualclassroom education delivery 93; data analytics processing 94;transaction processing 95; and, in the context of the illustratedembodiments of the present invention, various workloads and functions 96for managing memory for complex image analysis in a computingenvironment. In addition, workloads and functions 96 for managing memoryfor complex image analysis in a computing environment may include suchoperations as data analytics, data analysis, and as will be furtherdescribed, notification functionality. One with ordinary skill in theart will appreciate that the workloads and functions 96 for managingmemory for complex image analysis in a computing environment may alsowork in conjunction with other portions of the various abstractionslayers, such as those in hardware and software 60, virtualization 70,management 80, and other workloads 90 (such as data analytics processing94, for example) to accomplish the various purposes of the illustratedembodiments of the present invention.

As previously mentioned, the present invention provides for caching anddata-aware placement for acceleration of machine learning applicationsinvolving deep learning models. That is, the present invention providesa data acceleration system coupling distributed storage caching withcoordinated scheduling of data and training DL jobs. The distributedcache may be built on top of the memory and disks locally available onthe compute nodes of a system. The distributed cache may be used to feedthe GPUs with data providing near local storage I/O bandwidth. Whiledeploying a DL distributed job, a number of nodes may be designated tocache the dataset from remote storage. Training jobs may be deployedpreferably on those nodes. From the user perspective this reduces thetraining/inference time even if data is being sourced from a remotelocation. From the perspective of the service provider, this allowsbetter utilization of resources as local storage is no longer consideredas a strict requirement for the deployment of a job. This is inopposition to the current approach of dedicating a set of nodes to onetraining job even if not all the computing resources are being used. Inaddition, cached data can survive the execution of a training/inferenceand be reused by recurrent jobs (e.g., hyper-parameters tuning) or jobsthat share a popular dataset, improving the utilization of the clusternetwork bandwidth.

As previously indicated, the present invention provides for managingmemory for image analysis in a computing environment. An estimatedamount of memory may be reserved for one or more image analysis jobs andpartially suspending the one or more image analysis jobs upon memoryrequirements for the one or more image analysis jobs exceeding theestimated amount of memory. An upper bound of the estimated amount ofmemory may be estimated/predicted using a linear regression model withimage resolution as an independent variable and a prediction interval.The linear regression model may be trained using a target function thatpenalizes under estimation of the estimated amount of memory as comparedto over estimation.

In one aspect, memory reservation may be supported in parallel and/ordistributed computing environment. A job scheduler may have means and/orparameters for specifying the memory required for a job. A job may onlybe submitted if there is enough memory (as compared to the memoryrequested) in the system at the time of submission, otherwise the jobmay be queued until there is enough memory. The amount of memory to bereserved may be predicted without actually running a job such as, forexample, a job for image analysis.

Turning now to FIG. 4, a block diagram depicting exemplary functionalcomponents of a computing system 400 according to various mechanisms ofthe illustrated embodiments is shown. In one aspect, one or more of thecomponents, modules, services, applications, and/or functions describedin FIGS. 1-3 may be used in FIG. 4. As shown, the various blocks offunctionality are depicted with arrows designating the blocks'relationship with each other of computing system 400 and to show processflow. Additionally, descriptive information is also seen relating eachof the functional blocks of computing system 400. As will be seen, manyof the functional blocks may also be considered “modules” offunctionality, in the same descriptive sense as has been previouslydescribed in FIG. 4. With the foregoing in mind, the module blocks ofcomputing system 400 may also be incorporated into various hardware andsoftware components of a system for image enhancement in accordance withthe present invention. Many of the functional blocks of computing system400 may execute as background processes on various components, either indistributed computing components, or on the user device, or elsewhere.

Starting in block 404, an image 402 may be send to and/or received by areservation model and the reservation model may reserve an amount ofmemory (“M”). That is, the reservation model may reserve an estimatedamount of memory (“M”) for one or more image analysis jobs and partiallysuspending the one or more image analysis jobs upon memory requirementsfor the one or more image analysis jobs exceeding the estimated amountof memory. In block 406, a job scheduler may schedule one or more imageanalysis jobs with the estimated amount of memory (“M”) to memory 404A,404B, and/or 404C. In one aspect, the one or more image analysis jobsmay be queued at a time of job submission upon memory requirements forthe one or more image analysis jobs exceeding the estimated amount ofmemory (e.g., job queued if insufficient memory).

A thread compressor may compress one or more threads to ensurecompletion of the one or more image analysis jobs upon the one or moreimage analysis jobs upon exceeding the estimated amount of memory (e.g.,memory 404A, 404B, and/or 404C being out of memory), as in block 410.That is, the thread compressor may suspend and/or resume a threadaccording to defined memory state of the storage device/memory (e.g.,memory 404A, 404B, and/or 404C). At block 412, a spill coordinator mayspill and/or retrieve one more partitions of the one or more imageanalysis jobs to one or more storage devices (e.g., memory 404A, 404B,and/or 404C) to ensure completion of the one or more image analysis jobsupon the one or more image analysis jobs upon exceeding the estimatedamount of memory.

Turning now to FIG. 5A-5B, diagram 500 depicts managing memory forcomplex image analysis using a linear regression model. In one aspect,one or more of the components, modules, services, applications, and/orfunctions described in FIGS. 1-3 may apply and/or use the linearregression model of in FIG. 5A. In one aspect, a graph 510 of linearregression, using image resolution (e.g., pixels and/or voxels) as thedependent variable, may be used for approximation of memory (e.g., agigabyte “GB” of memory). As illustrated in graph 510, using linearregression of the following equation:

y=ƒ(x)=a*x+b   (1),

where a and b are computed using training data (xi, yi) . . . (xn, yn tominimize target function sum (F(xi)−yi)², as illustrated in graph 520 ofFIG. 5B, where the data values are for illustration purpose only. In oneaspect, the image size is not used (i.e., the number of bytes on disk)as different images may be using different encodings (e.g., byte, long,uncharacter, etc.), compressed and/or encrypted. In a pair-wise imageanalysis such as for example, medical image registration involving twoimages of voxels s1, and s2, image resolution “s” may determined by thelarger of the two images, as illustrated in the following equation:

s=max(s1,s2)   (2),

However, a regression model may under predict (“under-predict”) theamount of memory usage, which may cause job failures and/or performancedegradation.

As depicted in graph 520, the target function in the reservation modelpenalizes both over-prediction and under-prediction: sum (F(xi)−yi)². Toalleviate under reservation of memory from empirical observed data, thepresent invention may apply an energy function such as, for example,using the following equation:

E=αΣ _(ƒ(xi)<yi) [F(xi)−yi] ²(xi)+(1−α)Σ_(ƒ(xi)≥yi) [F(xi)−yi] ²(xi)  (3),

Where {xi, y}_(i=1) ^(n) may be an observed sample, where xi is theimage size and yi is used memory. The ƒ(xi)=a*xi+b is a linear functionfor fitting the data where a and b are parameters that are to be fitted0≤α≤1 is a parameter balancing the contributing from underfitting andoverfitting. Selecting α closer to the value of 1 may penalize underfitting more appropriately (e.g., heavier penalization) provided α, aand b can be solved through a least squared fitting.

In one aspect, a statistical prediction confidence interval “p” (e.g.,p=99%) of the linear model may be used to establish an upper bound forthe memory. For an image of resolution x₀, the memory consumption upperbound is:

f(x ₀)+T _(-crit) *SE   (3),

where SE is the standard error of the prediction given as follows:

$\begin{matrix}{{S_{yx}\sqrt{1 + \frac{1}{n} +}\left( \frac{\left( {x_{0} - \overset{\_}{x}} \right)^{2}}{{SS}_{x}} \right)},} & {(5),}\end{matrix}$

Where SS_(x)Σ(x_(i)−x)² is the mean deviation of image sizes from themean in the training set and the equation:

$\begin{matrix}{{S_{yx} = \frac{\sqrt{\sum\left( {{yi} - {f({xi})}} \right)^{2}}}{n}},} & (6)\end{matrix}$

is the standard error of the estimate from the linear model.T_(-crit)=T(p) is the student's t distribution value at p. The value ofp can be set to a high value (e.g. 95%) to ensure actual memory usage ishighly unlikely to exceed the upper bound or obtained through trial anderror. It should also be noted that 1) the “student's t-distribution”(or simply the t-distribution) is any member of a family of continuousprobability distributions that arises when estimating the mean of anormally distributed population in situations where the sample size issmall and population standard deviation is unknown and 2) even a slightunderestimation of few megabytes (“MB”) of memory can lead to jobfailures. Thus, the present invention increases robustness againstunderestimation and handles of out-of-memory conditions by employingfallback mechanisms to guarantee job completion in case of memoryunderestimation by using 1) a thread memory-compressor, and 2) aspilling operation, as more clearly illustrated in FIGS. 6 and 7.

Turning now to FIG. 6, an additional block diagram 600 depictingmanaging memory for complex image analysis according to a defined memorystate using a thread memory-compressor. In one aspect, one or more ofthe components, modules, services, applications, and/or functionsdescribed in FIGS. 1-4 may be used in FIG. 6. As illustrated inoperations 650 and 675 of FIG. 6, an estimated amount of memory for oneor more jobs (e.g., image analysis jobs) is depicted. Each imageanalysis job may include one or more threads of execution such as, forexample, threads 610, 620, 630, and/or 640 as illustrated. In order foreach job to complete, each thread (e.g., threads 610, 620, 630, and/or640) is required to complete each of their respective unit of work andwill wait for all the other threads to complete their units of work. Forexample, thread 610 waits for other threads such as, for example,threads 620, 630, and/or 640 to complete, and thread 620 is activelyrunning the job and then becomes idle.

In operation 675, each of the memory states (e.g., additional memorystates) may be managed such as, for example, a suspend state and aresume state at the thread level (e.g., threads 610, 620, 630, and/or640) are added to each job's context of execution. In one aspect, anexecuting/running thread may be suspended (e.g., threads 610 and 640 byway of example only in operation 650) when encountering memory pressureto not require any further memory and allow other threads to complete.The suspended thread may be resumed e.g., threads 610 and 640 by way ofexample only in operation 650). In the model of FIG. 6., at least onethread per job will make progress thereby guaranteeing job progress andcompletion. A worst-case model will be such that each thread willexecute one after another instead of running in parallel. This explainswhy the suspend-resume states may prolong the overall job completiontime.

Thus, each job can now be controlled at a thread level using theproactive consumption of memory, thereby augmenting the job-scheduler'ssubmit/queue model. In this way, the present invention reduces the totalfailure metrics without requiring expensive memory checkpoints topersistent storage media.

Said differently, the thread compressor suspends a thread, which meansthe thread is not requesting any more memory until the thread isresumed. In this way, the suspension of the thread (e.g., no longerrequesting memory) helps and assists to allow other threads to finishwhen memory becomes scarce, but still avoid expensive checkpointing topersistent storage. If no memory is available, then a spilling component(e.g., spilling coordinator 414 of FIG. 4) may take care ofcheckpointing and thereby, actively freeing memory (and not just preventthreads from acquiring additional memory).

FIG. 7 is an additional block diagram depicting a spilling operation formanaging memory for complex image analysis according to a defined memorystate. In one aspect, one or more of the components, modules, services,applications, and/or functions described in FIGS. 1-4 may be used inFIG. 7. As illustrated, FIG. 7 depicts a portioned image 710 having oneor more threads (e.g., Th1, Th2, Th3, and Th4), which may use/require aselected amount of memory 720 (e.g., a random-access memory). If thetotal memory requirements of a job (that includes the one or morethreads such as, for example, Th1, Th2, Th3, and Th4) exceed a totalaggregated amount of memory in the cluster, the job may only finish byjointly operating on memory 720 and disk 730. Thus, one or morepartitions/threads of the data may be spilled from memory 720 to disk730 to free up memory. The threads (e.g., Th1, Th2, Th3, and Th4), mayoperate on partitions of image 710 in parallel and only share smallstate. One or more individual threads (e.g., Th1, Th2, Th3, and Th4) maybe suspended and spill corresponding partition (e.g., Th4) to disk 730.The spilled partitions (e.g., Th4) may retrieved back to the disk 730(e.g., memory) and resume computation on completion (e.g., Th1 isfinished) of another thread when memory is freed.

FIG. 8 is a flowchart diagram 800 depicting an additional exemplarymethod for managing memory for image analysis by a processor in acomputing environment in which various aspects of the present inventionmay be realized. The functionality 800 may be implemented as a methodexecuted as instructions on a machine, where the instructions areincluded on at least one computer readable medium or one non-transitorymachine-readable storage medium. The functionality 800 may start inblock 802.

An estimated amount of memory may be reserved for an image analysis job,as in block 804. During a processing of the image analysis job, at leastone thread of the image analysis job is partially suspended byrestricting the image analysis job from requesting allocation ofadditional memory upon memory requirements for the image analysis jobexceeding the estimated amount of memory, as in block 806. Commensuratewith partially suspending the at least one thread, a state of the imageanalysis job is maintained in the memory notwithstanding the processingof the at least one thread associated with the state is suspended, as inblock 808. The functionality 800 may end, as in block 810.

FIG. 9 is an additional flowchart diagram 900 depicting an additionalexemplary method for managing memory for image analysis by a processorin a computing environment, again in which various aspects of thepresent invention may be realized. The functionality 900 may beimplemented as a method executed as instructions on a machine, where theinstructions are included on at least one computer readable medium orone non-transitory machine-readable storage medium. The functionality900 may start in block 902.

An estimated amount of memory may be reserved for one or more imageanalysis jobs and partially suspending the one or more image analysisjobs upon memory requirements for the one or more image analysis jobsexceeding the estimated amount of memory, as in block 904. An upperbound of the estimated amount of memory may be estimated/predicted usinga linear regression model with image resolution as an independentvariable and a prediction interval, as in block 906. The linearregression model may be trained using a target function that penalizesunder estimation of the estimated amount of memory as compared to overestimation, as in block 908. The functionality 900 may end, as in block910.

In one aspect, in conjunction with and/or as part of at least one blockof FIG. 8 or 9, the operations of methods 800 and/or 900 may includeeach of the following. The operations of methods 800 and/or 900 mayestimate an upper bound of the estimated amount of memory using a linearregression model with image resolution as an independent variable and aprediction interval and train the linear regression model using a targetfunction that penalizes under estimation of the estimated amount ofmemory as compared to over estimation.

The operations of methods 800 and/or 900 may compress one or moreapplications to ensure completion of the one or more image analysis jobsupon the one or more image analysis jobs upon exceeding the estimatedamount of memory, queue the one or more image analysis jobs at a time ofjob submission upon memory requirements for the one or more imageanalysis jobs exceeding the estimated amount of memory, and/or suspendor resume one or more threads of the one or more image analysis jobs.The operations of methods 800 and/or 900 may spill one or morepartitions of the one or more image analysis jobs to one or more storagedevices to ensure completion of the one or more image analysis jobs uponthe one or more image analysis jobs upon exceeding the estimated amountof memory, which may result in prolonging the job completion time, butguarantee job completion in case of memory underestimation, therebyincreasing robustness and graceful handling of runtime out of memorysituations.

The present invention may be a system, a method, and/or a computerprogram product. The computer program product may include a computerreadable storage medium (or media) having computer readable programinstructions thereon for causing a processor to carry out aspects of thepresent invention.

The computer readable storage medium can be a tangible device that canretain and store instructions for use by an instruction executiondevice. The computer readable storage medium may be, for example, but isnot limited to, an electronic storage device, a magnetic storage device,an optical storage device, an electromagnetic storage device, asemiconductor storage device, or any suitable combination of theforegoing. A non-exhaustive list of more specific examples of thecomputer readable storage medium includes the following: a portablecomputer diskette, a hard disk, a random access memory (RAM), aread-only memory (ROM), an erasable programmable read-only memory (EPROMor Flash memory), a static random access memory (SRAM), a portablecompact disc read-only memory (CD-ROM), a digital versatile disk (DVD),a memory stick, a floppy disk, a mechanically encoded device such aspunch-cards or raised structures in a groove having instructionsrecorded thereon, and any suitable combination of the foregoing. Acomputer readable storage medium, as used herein, is not to be construedas being transitory signals per se, such as radio waves or other freelypropagating electromagnetic waves, electromagnetic waves propagatingthrough a waveguide or other transmission media (e.g., light pulsespassing through a fiber-optic cable), or electrical signals transmittedthrough a wire.

Computer readable program instructions described herein can bedownloaded to respective computing/processing devices from a computerreadable storage medium or to an external computer or external storagedevice via a network, for example, the Internet, a local area network, awide area network and/or a wireless network. The network may comprisecopper transmission cables, optical transmission fibers, wirelesstransmission, routers, firewalls, switches, gateway computers and/oredge servers. A network adapter card or network interface in eachcomputing/processing device receives computer readable programinstructions from the network and forwards the computer readable programinstructions for storage in a computer readable storage medium withinthe respective computing/processing device.

Computer readable program instructions for carrying out operations ofthe present invention may be assembler instructions,instruction-set-architecture (ISA) instructions, machine instructions,machine dependent instructions, microcode, firmware instructions,state-setting data, or either source code or object code written in anycombination of one or more programming languages, including an objectoriented programming language such as Smalltalk, C++ or the like, andconventional procedural programming languages, such as the “C”programming language or similar programming languages. The computerreadable program instructions may execute entirely on the user'scomputer, partly on the user's computer, as a stand-alone softwarepackage, partly on the user's computer and partly on a remote computeror entirely on the remote computer or server. In the latter scenario,the remote computer may be connected to the user's computer through anytype of network, including a local area network (LAN) or a wide areanetwork (WAN), or the connection may be made to an external computer(for example, through the Internet using an Internet Service Provider).In some embodiments, electronic circuitry including, for example,programmable logic circuitry, field-programmable gate arrays (FPGA), orprogrammable logic arrays (PLA) may execute the computer readableprogram instructions by utilizing state information of the computerreadable program instructions to personalize the electronic circuitry,in order to perform aspects of the present invention.

Aspects of the present invention are described herein with reference toflowchart illustrations and/or block diagrams of methods, apparatus(systems), and computer program products according to embodiments of theinvention. It will be understood that each block of the flowchartillustrations and/or block diagrams, and combinations of blocks in theflowchart illustrations and/or block diagrams, can be implemented bycomputer readable program instructions.

These computer readable program instructions may be provided to aprocessor of a general-purpose computer, special purpose computer, orother programmable data processing apparatus to produce a machine, suchthat the instructions, which execute via the processor of the computeror other programmable data processing apparatus, create means forimplementing the functions/acts specified in the flowcharts and/or blockdiagram block or blocks. These computer readable program instructionsmay also be stored in a computer readable storage medium that can directa computer, a programmable data processing apparatus, and/or otherdevices to function in a particular manner, such that the computerreadable storage medium having instructions stored therein comprises anarticle of manufacture including instructions which implement aspects ofthe function/act specified in the flowcharts and/or block diagram blockor blocks.

The computer readable program instructions may also be loaded onto acomputer, other programmable data processing apparatus, or other deviceto cause a series of operational steps to be performed on the computer,other programmable apparatus or other device to produce a computerimplemented process, such that the instructions which execute on thecomputer, other programmable apparatus, or other device implement thefunctions/acts specified in the flowcharts and/or block diagram block orblocks.

The flowcharts and block diagrams in the Figures illustrate thearchitecture, functionality, and operation of possible implementationsof systems, methods, and computer program products according to variousembodiments of the present invention. In this regard, each block in theflowcharts or block diagrams may represent a module, segment, or portionof instructions, which comprises one or more executable instructions forimplementing the specified logical function(s). In some alternativeimplementations, the functions noted in the block may occur out of theorder noted in the figures. For example, two blocks shown in successionmay, in fact, be executed substantially concurrently, or the blocks maysometimes be executed in the reverse order, depending upon thefunctionality involved. It will also be noted that each block of theblock diagrams and/or flowchart illustrations, and combinations ofblocks in the block diagrams and/or flowchart illustrations, can beimplemented by special purpose hardware-based systems that perform thespecified functions or acts or carry out combinations of special purposehardware and computer instructions.

1. A method for managing memory for image analysis by a processor incomputing environment, comprising: reserving an estimated amount ofmemory for an image analysis job; and during a processing of the imageanalysis job, partially suspending at least one thread of the imageanalysis job by restricting the image analysis job from requestingallocation of additional memory upon memory requirements for the imageanalysis job exceeding the estimated amount of memory; whereincommensurate with partially suspending the at least one thread, a stateof the image analysis job is maintained in the memory notwithstandingthe processing of the at least one thread associated with the state issuspended.
 2. The method of claim 1, further including estimating anupper bound of the estimated amount of memory using a linear regressionmodel with image resolution as an independent variable and a predictioninterval.
 3. The method of claim 2, further including training thelinear regression model using a target function that penalizes underestimation of the estimated amount of memory as compared to overestimation.
 4. The method of claim 1, further including compressing oneor more applications to ensure completion of the image analysis job uponthe image analysis job exceeding the estimated amount of memory.
 5. Themethod of claim 1, further including queuing the image analysis job at atime of job submission upon memory requirements for the image analysisjob exceeding the estimated amount of memory.
 6. The method of claim 1,further including resuming the at least one thread of the image analysisjob according to the state maintained in the memory.
 7. The method ofclaim 1, further including spilling one or more partitions of the imageanalysis job to one or more storage devices to ensure completion of theimage analysis job upon the image analysis job exceeding the estimatedamount of memory.
 8. A system for managing memory for image analysis bya processor in a multi-tenant computing environment, comprising: one ormore computers with executable instructions that when executed cause thesystem to: reserve an estimated amount of memory for an image analysisjob; and during a processing of the image analysis job, partiallysuspend at least one thread of the image analysis job by restricting theimage analysis job from requesting allocation of additional memory uponmemory requirements for the image analysis job exceeding the estimatedamount of memory; wherein commensurate with partially suspending the atleast one thread, a state of the image analysis job is maintained in thememory notwithstanding the processing of the at least one threadassociated with the state is suspended.
 9. The system of claim 8,wherein the executable instructions further estimate an upper bound ofthe estimated amount of memory using a linear regression model withimage resolution as an independent variable and a prediction interval.10. The system of claim 9, wherein the executable instructions furthertrain the linear regression model using a target function that penalizesunder estimation of the estimated amount of memory as compared to overestimation.
 11. The system of claim 8, wherein the executableinstructions further compress one or more applications to ensurecompletion of the image analysis job upon the image analysis jobexceeding the estimated amount of memory.
 12. The system of claim 8,wherein the executable instructions further queue the image analysis jobat a time of job submission upon memory requirements for the imageanalysis job exceeding the estimated amount of memory.
 13. The system ofclaim 8, wherein the executable instructions further resume the at leastone thread of the image analysis job according to the state maintainedin the memory.
 14. The system of claim 8, wherein the executableinstructions further spill one or more partitions of the image analysisjob to one or more storage devices to ensure completion of the imageanalysis job upon the image analysis job exceeding the estimated amountof memory.
 15. A computer program product for managing memory for imageanalysis by a processor in a multi-tenant computing environment, thecomputer program product comprising a non-transitory computer-readablestorage medium having computer-readable program code portions storedtherein, the computer-readable program code portions comprising: anexecutable portion that reserves an estimated amount of memory for animage analysis job; and an executable portion that, during a processingof the image analysis job, partially suspends at least one thread of theimage analysis job by restricting the image analysis job from requestingallocation of additional memory upon memory requirements for the imageanalysis job exceeding the estimated amount of memory; whereincommensurate with partially suspending the at least one thread, a stateof the image analysis job is maintained in the memory notwithstandingthe processing of the at least one thread associated with the state issuspended.
 16. The computer program product of claim 15, furtherincluding an executable portion that: estimates an upper bound of theestimated amount of memory using a linear regression model with imageresolution as an independent variable and a prediction interval; andtrains the linear regression model using a target function thatpenalizes under estimation of the estimated amount of memory as comparedto over estimation.
 17. The computer program product of claim 15,further including an executable portion that compresses one or moreapplications to ensure completion of the image analysis job upon theimage analysis job exceeding the estimated amount of memory.
 18. Thecomputer program product of claim 15, further including an executableportion that queues the image analysis job at a time of job submissionupon memory requirements for the image analysis job exceeding theestimated amount of memory.
 19. The computer program product of claim15, further including an executable portion that resumes the at leastone thread of the image analysis job according to the state maintainedin the memory.
 20. The computer program product of claim 15, furtherincluding an executable portion that spills one or more partitions ofthe image analysis job to one or more storage devices to ensurecompletion of the image analysis job upon the image analysis jobexceeding the estimated amount of memory.